import request from '@/utils/request';

let baseURL = '/property-portal/v1/api';

// 设施库项目列表
export const facilityProjectListApi = params => {
	return request({
		url: `${baseURL}/facility/queryProjectFacilityList`,
		method: 'post',
		data: params,
	});
};

// 保养计划项目列表
export const planFacilityProjectListApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/queryProjectFacilityMaintenanceList`,
		method: 'post',
		data: params,
	});
};

// 设施-新增--------------------------------------------------------------------设施----------------------------------------------------------------------
export const facilityAddApi = params => {
	return request({
		url: `${baseURL}/facility/create`,
		method: 'post',
		data: params,
	});
};

// 设施-更新
export const facilityUpdateApi = params => {
	return request({
		url: `${baseURL}/facility/update`,
		method: 'post',
		data: params,
	});
};

// 设施-详情
export const facilityInfoApi = params => {
	return request({
		url: `${baseURL}/facility/detail/${params}`,
		method: 'get',
	});
};

// 设施-列表
export const facilityListApi = params => {
	return request({
		url: `${baseURL}/facility/queryFacilityList`,
		method: 'post',
		data: params,
	});
};

// 设施-二维码下载
export const facilityQrCodeDownloadApi = params => {
	return request({
		url: `${baseURL}/facility/download`,
		method: 'post',
		data: params
	});
};

//设备二维码批量下载
export const batchDownloadApi = params => {
	return request({
		url: `${baseURL}/facility/downloadZip`,
		method: 'post',
		data: params,
		responseType: 'blob',
	});
};

// 设备-导出
export const facilityExportApi = data => {
	return request({
		url: `${baseURL}/facility/exportFacility`,
		method: 'post',
		data,
		responseType: 'blob',
	});
};

// 设备-导入
export const facilityImportApi = params => {
	return request({
		url: `${baseURL}/facility/importFacility`,
		method: 'post',
		data: params,
	});
};

// 验收标准-新增-----------------------------------------------------------------验收标准-----------------------------------------------------------------
export const standardAddApi = params => {
	return request({
		url: `${baseURL}/facilityAcceptanceStandard/create`,
		method: 'post',
		data: params,
	});
};

// 验收标准-更新
export const standardUpdateApi = params => {
	return request({
		url: `${baseURL}/facilityAcceptanceStandard/update`,
		method: 'post',
		data: params,
	});
};

// 验收标准-删除
export const standardDeleteApi = params => {
	return request({
		url: `${baseURL}/facilityAcceptanceStandard/delete/${params}`,
		method: 'delete',
	});
};

// 验收标准-详情
export const standardInfoApi = params => {
	return request({
		url: `${baseURL}/facilityAcceptanceStandard/detail/${params}`,
		method: 'get',
	});
};

// 验收标准-列表
export const standardListApi = params => {
	return request({
		url: `${baseURL}/facilityAcceptanceStandard/list`,
		method: 'post',
		data: params,
	});
};

// 保养计划-列表--------------------------------------------------------------保养计划-----------------------------------------------------------------
export const planMaintainListApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/queryMaintenanceList`,
		method: 'post',
		data: params,
	});
};

// 保养计划-新增
export const planMaintainAddApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/create`,
		method: 'post',
		data: params,
	});
};

// 保养计划-更新
export const planMaintainUpdateApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/update`,
		method: 'post',
		data: params,
	});
};

// 保养计划-详情
export const planMaintainInfoApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/detail/${params}`,
		method: 'get',
	});
};

// 保养计划-可选择的设施列表
export const planFacilityListApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/queryFacilityList`,
		method: 'post',
		data: params,
	});
};

// 保养计划-设施绑定
export const planFacilityBindApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/maintenanceFacilityBind`,
		method: 'post',
		data: params,
	});
};

// 新增保养计划-选择角色
export const rolePlanListApi = params => {
	return request({
		url: `${baseURL}/planFacilityMaintenance/facilityMaintenanceRoleDropDown`,
		method: 'post',
		data: params,
	});
};
